#include "random.hpp"

using namespace std;

/* --------------------------------------------------------------- */
Random::Random() {
	srand ( time(NULL) );
}
/* --------------------------------------------------------------- */
int Random::getInt(int min, int max) {
	return (rand() % (max - min + 1)) + min;
}
/* --------------------------------------------------------------- */
std::vector<int> * Random::getRandPerm(int min, int max) {
	vector<int> temp, * ret;
	vector<int>::iterator it;
	int i, r;

	ret = new vector<int>();

	for(int i = min; i <= max; i++) {
		temp.push_back(i);
	}
	int size = temp.size();
	for(i = 0; i < size; i++) {
		r = getInt(0, temp.size()-1);
		ret->push_back(temp[r]);
		temp.erase(temp.begin() + r);
	}

	return ret;
}
/* --------------------------------------------------------------- */
